home *** CD-ROM | disk | FTP | other *** search
- /*************************************************************************************************
- *
- *
- * ObjectMacZapp -- a standard Mac OOP application template
- *
- *
- *
- * ZScroller.h -- a window with scrollbars
- *
- *
- *
- *
- *
- * © 1996, Graham Cox
- *
- *
- *
- *
- *************************************************************************************************/
-
-
- #pragma once
-
- #ifndef __ZSCROLLER__
- #define __ZSCROLLER__
-
-
- #include "ZWindow.h"
-
- /*
- ZScroller is a window that has scrollbars in the usual way. The scrollBounds sets the size
- of the area that the window can show- if this is ever less than the window content the
- scrollbars will be disabled. The scale values set how many pixels to move in each direction
- for each increment of the scrollbar. Override this class to implement scrolling windows with
- REAL content.
- */
-
-
- class ZScroller : public ZWindow
- {
- protected:
- ControlHandle theHBar;
- ControlHandle theVBar;
- Rect scrollBounds;
- short hScale;
- short vScale;
- Boolean hasHBar;
- Boolean hasVBar;
-
- public:
-
- ZScroller(ZCommander* aBoss, short windID, Boolean hasHScroll, Boolean hasVScroll);
-
- virtual void InitZWindow();
- virtual void Activate();
- virtual void Deactivate();
- virtual void Draw();
- virtual void DrawGrow();
- virtual void Click(Point mouse, short modifiers);
- virtual void SetSize(short width, short height);
- virtual void Zoom(short partCode);
- virtual void SetBounds(Rect* bounds);
- virtual void GetBounds(Rect* bounds);
- virtual void SetScrollAmount(short hAmount, short vAmount);
- virtual void GetPosition(short* hPosition, short* vPosition);
- virtual void ScrollTo(short hPosition, short vPosition);
- virtual void GetContentRect(Rect* aRect);
- virtual void ClickContent(Point mouse, short modifiers);
- virtual void Scroll(short dH, short dV);
-
- protected:
-
- virtual void CalculateControlParams();
- virtual void MakeScrollbars();
- virtual void MoveScrollbars();
- virtual void PostScroll();
- virtual void SetOriginToScroll();
-
- public:
-
- virtual void ScrollHandler(ControlHandle aCtl, short partCode);
- };
-
-
- #define kStdScrollbarWidth 15
-
-
-
- #endif